<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/23
 * Time: 19:09
 */
class myException extends Exception{
    public function getAllInfo(){
        return "异常发生信息为：{$this->getMessage()}";
    }
}
try{
    $age=-1;
    if($age<0){
    //    $x=new Exception("你的年龄变成负数的了");
        throw $x;
    }else{

    }
}catch (Exception $e){
    echo $e->getMessage();
}

var_dump($x);